package com.byb.server.service.dto.Wc;

import com.byb.server.service.dto.WcInsuranceTypeDTO;

import java.io.Serializable;
import java.util.Objects;

public class WcSearchProductDTO implements Serializable {

    private Long id;

    private String name;

    /**
     * 评价
     */
    private String evaluation;

    /**
     * 排名
     */
    private String ranking;

    private Long wcIsurerId;

    /**
     * 公司
     */
    private String wcIsurerName;

    private Long wcInsuranceCategoryId;

    /**
     * 险种-类别
     */
    private String wcInsuranceCategoryName;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getEvaluation() {
        return evaluation;
    }

    public void setEvaluation(String evaluation) {
        this.evaluation = evaluation;
    }

    public String getRanking() {
        return ranking;
    }

    public Double getRankDouble(){
        return Double.parseDouble(ranking);
    }

    public void setRanking(String ranking) {
        this.ranking = ranking;
    }

    public Long getWcIsurerId() {
        return wcIsurerId;
    }

    public void setWcIsurerId(Long wcIsurerId) {
        this.wcIsurerId = wcIsurerId;
    }

    public String getWcIsurerName() {
        return wcIsurerName;
    }

    public void setWcIsurerName(String wcIsurerName) {
        this.wcIsurerName = wcIsurerName;
    }

    public Long getWcInsuranceCategoryId() {
        return wcInsuranceCategoryId;
    }

    public void setWcInsuranceCategoryId(Long wcInsuranceCategoryId) {
        this.wcInsuranceCategoryId = wcInsuranceCategoryId;
    }

    public String getWcInsuranceCategoryName() {
        return wcInsuranceCategoryName;
    }

    public void setWcInsuranceCategoryName(String wcInsuranceCategoryName) {
        this.wcInsuranceCategoryName = wcInsuranceCategoryName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        WcSearchProductDTO wcSearchProductDTO = (WcSearchProductDTO) o;
        if(wcSearchProductDTO.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), wcSearchProductDTO.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }
}
